set (ukey_SRC
    ukey.cpp)

include_directories(epass2003/x86_64/sample/include/)
link_directories(${PROJECT_SOURCE_DIR}/ukey/epass2003/x86_64/redist/)
add_definitions(-Dlinux)

add_library(ukey_static STATIC ${ukey_SRC})

# cmd
add_executable(dra_ukey cmd/dra_ukey.cpp)
target_link_libraries(dra_ukey ukey_static gwbase 
    pthread ssl curl sqlite3
    jsoncpp_static borzoi crypto z 
    castle)

# tests
add_executable(ukey_test ukey_test.cpp)
target_link_libraries(ukey_test ukey_static gwbase 
    pthread ssl curl sqlite3
    jsoncpp_static borzoi crypto z 
    castle)

install(TARGETS dra_ukey DESTINATION bin)
install(FILES ${PROJECT_SOURCE_DIR}/ukey/epass2003/x86_64/redist/libcastle.so 
    DESTINATION bin 
    PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ 
    GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ)
